package sjtu.ist.warehouse4ws.action;
import java.util.ArrayList;
import java.util.List;

import org.apache.struts2.json.annotations.JSON;

import sjtu.ist.warehouse4ws.model.Column;
import sjtu.ist.warehouse4ws.model.Oplog;
import sjtu.ist.warehouse4ws.service.ColumnService;
import sjtu.ist.warehouse4ws.service.OplogService;
import sjtu.ist.warehouse4ws.service.cust.CustColumnService;

import com.opensymphony.xwork2.ActionSupport;

public class OplogAction extends ActionSupport {
	//service
	private OplogService oplogService;
	
	private List<Oplog> oplogList=new ArrayList<Oplog>();
	
	public String showAllOplog(){
		oplogList=oplogService.getAll();
		
		return SUCCESS;
	}
	
	public String searchOplog(){
		return SUCCESS;
	}
	
	@JSON(name = "oplog")
	public List<Oplog> getOplogList() {
		return oplogList;
	}

	@JSON(name = "total")
	public int getTotalOplogList() {
		return oplogList.size();
	}

	/**
	 * @param oplogService the oplogService to set
	 */
	public void setOplogService(OplogService oplogService) {
		this.oplogService = oplogService;
	}
}